home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac-Source 1994 July
/
Mac-Source_July_1994.iso
/
C and C++
/
Compilers⁄Interps
/
little-c
/
Ex4.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1993-10-04
|
206 b
|
17 lines
|
[
TEXT/????
]
/* This program demonstrates recursive functions. */
main()
{
print(factr(7) * 2);
}
/* return the factorial of i */
factr(int i)
{
if(i<2) {
return 1;
}
else {
return i * factr(i-1);
}
}